from taobao.mysqls import PyMysql
import pandas

class Read():
    def __init__(self):
        self.sql_conn=PyMysql().sqlalchemy_conn()

    def read_yyjj(self):
        df=pandas.read_csv('yyjj.csv', encoding='utf-8')
        print(df)
        df.to_sql(
            name="yi_yong_jiu_jing",
            con=self.sql_conn,
            if_exists='replace',
            index=False,
        )


    def read_kz(self):
        df=pandas.read_csv('kz.csv',encoding='utf-8')
        print(df)
        df.to_sql(
            name='kou_zhao',
            con=self.sql_conn,
            if_exists='replace',
            index=False,
        )

if __name__ == '__main__':
    r=Read()
    r.read_kz()
    r.read_yyjj()




